
<center>
    {if ($arrData)}	
	    {$oldMeisho = ''}
	    {$cnt = count($arrData)}
	    {$i = 0}
		{$item = null}
		{$total_delivery_fee = 0}
	    {foreach $arrData as $item}
	    	{$newMeisho = $item['sql03']['maker_cd']}
		        <!-- first row -->
		        {if ($oldMeisho != $newMeisho && $i != 0)}	
			                <tr>
			                	<td colspan='5' align='right'>
									<div>合計額 　　　　　　　　　　　　{number_format($total_delivery_fee)}</div>
									{$sum_fee_tax = 0}
			                		{if ($item['sql03']['tax_round_classification'] == 0) }
			                			{$sum_fee_tax = floor($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{elseif ($item['sql03']['tax_round_classification'] == 1) }
			                			{$sum_fee_tax = ceil($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{else}
			                			{$sum_fee_tax = round($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{/if}							
									<div> 　　　 　　　消費税 　　　{number_format($sum_fee_tax)}</div>
									<div>請求額　　　　　　　　　　　　{number_format($sum_fee_tax + $total_delivery_fee)}</div>
			                	</td>
			                </tr>
			            </table>
				    </div>	
				    {$total_delivery_fee = 0}	
		        {/if}		    	
		    	{if ($oldMeisho != $newMeisho)}
		    		{if $i != 0}
		    			<div id='page_break'>&nbsp;&nbsp;</div>
		    		{/if}			               	
					<h2>
						{if ($item['sql03']['maker_cd'] == $smarty.const.MAKER_CD_REPORT_NO_SPECIAL)} 
				   			荷主別届先　特別条件一覧　　　　　　<span style='font-size: 20px'>{$item['sql03']['month']}月分</span>
				   		{else}
				   			荷主別届先配送手数料一覧　　　　　　<span style='font-size: 20px'>{$item['sql03']['month']}月分</span>
				   		{/if}
					</h2>
					<hr/>
					<div align='left'>　　荷主名　　{$item['sql03']['maker_cd']} 　　　　　　{$item['sql03']['maker_name']}</div>
					<hr/>
				    <div id='shipper_content' style="width:800px">
				            <table id='tblShipper' cellspacing='0' cellpadding='0' border='0' width='100%'>
				            	<tr>
						                    <th>届先コード</th>
						                    <th>届先エリア名</th>
						                    <th>個口数</th>
						                    <th>単価</th>
						                    <th>手数料金額</th>
						        </tr>
				{/if}						        
		                    <tr>
		                        <td align='left'>
		                        	{$item['sql03']['area_cd']}
		                        </td>
		                        <td align='left'>
		                         	{$item['sql03']['area_name']}
		                        </td>
		                        <td align='left'>
		                         	{$item['sql03']['sum_person_count']}
		                        </td>
		                        <td align='right'>
		                         	{round($item['sql03']['delivery_fee'])}
		                        </td>
		                        <td align='right'>
		                         	{number_format(round($item['sql03']['delivery_fee_sum']))}
		                        </td>		                        
		                    </tr>
		                    {$total_delivery_fee = $total_delivery_fee + $item['sql03']['delivery_fee_sum']}
		    {if ($i == $cnt - 1)}
			                <tr>
			                	<td colspan='5' align='right'>
									<div>合計額 　　　　　　　　　　　　{number_format($total_delivery_fee)}</div>
									{$sum_fee_tax = 0}
			                		{if ($item['sql03']['tax_round_classification'] == 0) }
			                			{$sum_fee_tax = floor($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{elseif ($item['sql03']['tax_round_classification'] == 1) }
			                			{$sum_fee_tax = ceil($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{else}
			                			{$sum_fee_tax = round($total_delivery_fee*$item['sql03']['consump_tax_rate']/100)}
			                		{/if}							
									<div> 　　　 　　　消費税 　　　{number_format($sum_fee_tax)}</div>
									<div>請求額　　　　　　　　　　　　{number_format($sum_fee_tax + $total_delivery_fee)}</div>
			                	</td>
			                </tr>
			            </table>
				    </div>	
				{/if}		    
			    {$i = $i + 1}
			    {$oldMeisho = $newMeisho}
		    {/foreach}
        {else}
            データーが有りません。
        {/if}    
</center>